From KnowYourMeme:
Caramelldansen (eng. The Caramel Dance) is a series of animated dance videos that use the dance track with the same title. Its original track was released in Supergott which is the 2nd album of the Swedish pop group Caramell in November 2001.
The big sensation was caused on the web by the huge amount of fan-made videos and artworks in such as YouTube, deviantART and the Japanese video sharing service Nico Nico Douga (NND) around 2008 to 2009. In February 2020, Caramelldancen regained meme popularity with Caramelldancen Lights edits.
According to Ruakuu's Blog, The origin of Caramelldansen was the flash loop composed by Sven from Sweden at the first half on 2006, and it was originally posted on his personal website.